package com.waitingresult.bzzc.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.waitingresult.bzzc.entity.Brand;
import com.waitingresult.bzzc.mapper.BrandMapper;
import com.waitingresult.bzzc.qo.BrandQo;
import com.waitingresult.bzzc.service.BrandService;
import com.waitingresult.common.base.service.impl.AbstractBaseServiceImpl;
import org.springframework.stereotype.Service;


/**
 * All right reserved,Designed By WangShuai
 *
 * @author : WangShuai
 * @version : V1.0
 * @ClassName : BrandService
 * @Description :
 * @date : 2021/11/28 00:06
 */

@Service
public class BrandServiceImpl extends AbstractBaseServiceImpl<BrandMapper, Brand, BrandQo> implements BrandService {

    @Override
    public LambdaQueryWrapper<Brand> getLamdaQueryWrapper(BrandQo qo) {
        return new LambdaQueryWrapper<Brand>()
                .eq(ObjectUtil.isNotNull(qo.getId()), Brand::getId, qo.getId())
                .eq(ObjectUtil.isNotNull(qo.getStatus()), Brand::getStatus, qo.getStatus())
                .like(ObjectUtil.isNotNull(qo.getName()), Brand::getName, qo.getName());

    }
}
